-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed the parse_run_traces to include last 4 letters of run_id #1880
base: main
Are you sure you want to change the base?
Conversation
The code changed was small
to this
which does not change much of the functionality of comparing classes while iterating |
Hi @jjmachan, does this solution align with with the given issue? |
src/ragas/callbacks.py
Outdated
@@ -164,7 +164,7 @@ def parse_run_traces( | |||
prompt_trace = traces[prompt_uuid] | |||
output = prompt_trace.outputs.get("output", {}) | |||
output = output[0] if isinstance(output, list) else output | |||
prompt_traces[f"{prompt_trace.name}"] = { | |||
prompt_traces[f"{prompt_trace.name}_{prompt_trace.run_id[:4]}"] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prompt_traces[f"{prompt_trace.name}_{prompt_trace.run_id[:4]}"] = { | |
prompt_traces[f"{prompt_trace.name}_{i}"] = { |
what if we use i instead? would that be better?
right now I think it might be a bit more confusing, since users have no way of guessing the run_id. this would make it a bit more predictable - what do you think?
ps: Thanks a lot for taking the time to fix it 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed the user won't have a clue about what run_id it is and therefore can be bit confusing, If we append the {i}
,
The output would be more like
{'claim_decomposition_prompt_1': {'input': ClaimDecompositionInput(response='Eifel tower is in Paris', sentences=['Eifel tower is in Paris']), 'output': ClaimDecompositionOutput(decomposed_claims=[['Eiffel
tower is in Paris']])}, 'n_l_i_statement_prompt_2': {'input': NLIStatementInput(context='Paris, France is a city where Eifel tower is located', statements=['Eiffel tower is in Paris']), 'output':
NLIStatementOutput(statements=[StatementFaithfulnessAnswer(statement='Eiffel tower is in Paris', reason='The context explicitly states that Eiffel tower is located in Paris, France.', verdict=1)])},
'claim_decomposition_prompt_3': {'input': ClaimDecompositionInput(response='Paris, France is a city where Eifel tower is located', sentences=['Paris, France is a city where Eifel tower is located']),
'output': ClaimDecompositionOutput(decomposed_claims=[['Paris is a city in France.'], ['Eiffel Tower is located in Paris.']])}, 'n_l_i_statement_prompt_4': {'input': NLIStatementInput(context='Eifel tower is
in Paris', statements=['Paris is a city in France.', 'Eiffel Tower is located in Paris.']), 'output': NLIStatementOutput(statements=[StatementFaithfulnessAnswer(statement='Paris is a city in France.',
reason='The context does not provide any information about the location of Paris.', verdict=0), StatementFaithfulnessAnswer(statement='Eiffel Tower is located in Paris.', reason='The context explicitly states
that the Eiffel Tower is in Paris.', verdict=1)])}}
This solution is more user-centric, considering that the last digit simply represents a sequence of events occurring within Ragas' reasoning process.
Hi @jjmachan, updated the traces functionality to have New traces should look like
|
Hi @sahusiddharth, can you check, is this because of the previous unit test PR you have made? |
hey @Vidit-Ostwal this is great - much for readable but one concern is that this is too big of a change and might break - can I keep this on pause till v0.3? we are planning to maybe release that with another feature we wanted. This way we keep the honor semver best @sahusiddharth also roping you in on this |
@jjmachan, sure. |
#1871
Changed the parse_run_traces function, to include the last 4 letter of the run_id of the trace, result of which is a unique key for every call.